/**
 * 
 */
package de.nak.fireDepartment.service;

import java.util.Collection;

import de.nak.fireDepartment.exceptions.CarNotFoundException;
import de.nak.fireDepartment.exceptions.EquipmentAlreadyExistsException;
import de.nak.fireDepartment.exceptions.EquipmentNotFoundException;
import de.nak.fireDepartment.exceptions.ErrorOnDeleteException;
import de.nak.fireDepartment.model.Equipment;

/**
 * Interface for the equipment service.
 * @author Nils Bredow
 */
public interface EquipmentService {
	/**
	 * Creates a new equipment and stores it in the database
	 * @param modelName
	 * @param yearOfManufacture
	 * @param manufactureCompany
	 * @param descriptionText
	 * @param imageURL
	 * @throws EquipmentAlreadyExistsException
	 * @throws CarNotFoundException
	 */
	void createEquipment(String modelName,
						 String yearOfManufacture,
						 String manufactureCompany,
						 String descriptionText,
						 String imageURL) throws EquipmentAlreadyExistsException,CarNotFoundException;

	/**
	 * List all equipments currently stored in the database.
	 *
	 * @return a list of Equipment entities. If no equipment was found an empty list is
	 *         returned.
	 */
	Collection<Equipment> listEquipments();

	/**
	 * Returns the equipment identified by the given id.
	 *
	 * @param id The identifier.
	 * @return the found entity.
	 * @throws EquipmentNotFoundException
	 */
	Equipment showEquipment(Long id) throws EquipmentNotFoundException;

	/**
	 * Updates an equipment entity and stores the changes into the database
	 * @param id
	 * @param modelName
	 * @param yearOfManufacture
	 * @param manufactureCompany
	 * @param descriptionText
	 * @param imageURL
	 * @throws EquipmentNotFoundException
	 * @throws CarNotFoundException
	 * @throws EquipmentAlreadyExistsException 
	 */
	void updateEquipment(long id,
						 String modelName,
						 String yearOfManufacture,
						 String manufactureCompany,
						 String descriptionText,
						 String imageURL) throws EquipmentNotFoundException,CarNotFoundException, EquipmentAlreadyExistsException;

	/**
	 * Deletes the equipment with the given id.
	 *
	 * @param id The identifier.
	 * @throws ErrorOnDeleteException 
	 * @throws EquipmentNotFoundException
	 */
	void deleteEquipment(Long id) throws EquipmentNotFoundException, ErrorOnDeleteException;

}
